home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
276-300
/
294
/
dnet
/
amiga
/
lib
/
dopen.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-14
|
850b
|
48 lines
/*
* DOpen.C
*/
#include "lib.h"
PORT *
DOpen(host, portnum, txpri, rxpri)
char *host;
int txpri, rxpri;
uword portnum;
{
IOSTD ior;
CHANN *chan;
if (!host)
host = "0";
chan = (CHANN *)MakeChannel(&ior, host);
if (rxpri > 126)
rxpri = 126;
if (rxpri < -127)
rxpri = -127;
if (txpri > 126)
txpri = 126;
if (txpri < -127)
txpri = -127;
if (chan->dnetport) {
ior.io_Command = DNCMD_OPEN;
ior.io_Unit = (void *)portnum;
ior.io_Offset = (long)chan;
ior.io_Message.mn_ReplyPort = (PORT *)chan;
ior.io_Message.mn_Node.ln_Pri = txpri;
ior.io_Message.mn_Node.ln_Name= (char *)rxpri;
PutMsg(chan->dnetport, (MSG *)&ior);
WaitMsg(&ior);
if (ior.io_Error == 0) {
chan->chan = (long)ior.io_Unit;
FixSignal(chan);
return((PORT *)chan);
}
}
DeleteChannel(chan);
return(NULL);
}